package org.example.mapper;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.example.pojo.Group;

import java.util.List;

@Mapper
public interface GroupMapper {
    @Select("select * from `group` where user_id=#{userId}")
    List<Group> groupList(Integer userId);
    @Insert("insert into `group`(user_id, group_name) values(#{userId}, #{groupName})")
    void addGroup(Group group);
    @Delete("delete from `group` where id=#{id}")
    void delGroup(Group group);
}
